package com.wxq.demo.service;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class SenderService {

    @Autowired
    private AmqpTemplate amqpTemplate;

    public void send1() {
        amqpTemplate.convertAndSend("exchange", "topic.message", "hello,rabbit~1");
    }

    public void send2() {
        amqpTemplate.convertAndSend("exchange", "topic.messages", "hello,rabbit~2");
    }
}
